/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-10-28
 * Time: 17:19
 */
public class Demo2 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            for (int i = 0; i < 3; i++) {
                System.out.println("hello thread");
            }
            System.out.println("t线程结束了");
        });
        t.start();
        t.join();
        System.out.println(t.getState());
        System.out.println("main线程结束了");
    }
}